<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>N3RD CH4T: /Users/plamontagna/Documents/spa-cs340project/im_client_v2/client.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">N3RD CH4T
   &#160;<span id="projectnumber">Final Version</span>
   </div>
   <div id="projectbrief">CS340 Project</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">/Users/plamontagna/Documents/spa-cs340project/im_client_v2/client.h</div>  </div>
</div>
<div class="contents">
<a href="client_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// ----------------------------------------------------------------------------</span>
<a name="l00019"></a>00019 <span class="comment"></span><span class="comment">// ----------------------------------------------------------------------------</span>
<a name="l00020"></a>00020 
<a name="l00021"></a>00021 <span class="preprocessor">#ifndef CLIENT_H</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define CLIENT_H</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;QtGui/QLabel&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;QTcpSocket&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;QtNetwork&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;QMessageBox&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;QObject&gt;</span>
<a name="l00029"></a>00029 
<a name="l00037"></a><a class="code" href="class_client.html">00037</a> <span class="keyword">class </span><a class="code" href="class_client.html" title="The Client helper methods.">Client</a>: <span class="keyword">public</span> QObject
<a name="l00038"></a>00038 {
<a name="l00039"></a>00039     Q_OBJECT
<a name="l00040"></a>00040 <span class="keyword">public</span>:
<a name="l00041"></a>00041 
<a name="l00046"></a>00046     <a class="code" href="class_client.html#a67b6b47afd0b3036ba2bb42bb206adab">Client</a>(QString <a class="code" href="class_client.html#a6fa0bad86c4de7169b1cdc7775bcdb9e" title="IP address variable.">address</a>, quint16 <a class="code" href="class_client.html#a955368517c3df7db98439442267a603c" title="Create a port variable.">port</a>, QString <a class="code" href="class_client.html#aabaf912148bc9f464b7cbaa16584ffa6" title="Create a string username variable.">userName</a>);
<a name="l00047"></a>00047 
<a name="l00052"></a>00052     <span class="keywordtype">bool</span> <a class="code" href="class_client.html#ae7a0fd3f7ee22707e9a551a997c7135c" title="Boolean method that returns a successful or failed connection.">startClient</a>();
<a name="l00053"></a>00053 
<a name="l00059"></a>00059     QString <a class="code" href="class_client.html#a0b872012d2a974af9bb6e53a999b21aa" title="Method that gets the clients username.">getUserName</a>();
<a name="l00060"></a>00060 
<a name="l00066"></a>00066     QString <a class="code" href="class_client.html#af040dd062cd74992c0eb7f4396611422" title="Method that gets the clients host address.">getAddress</a>();
<a name="l00067"></a>00067 
<a name="l00073"></a>00073     quint16 <a class="code" href="class_client.html#a7e92f41d3a0f1c0cde89a02d1eeb2a2a" title="Method that gets the clients port.">getPort</a>();
<a name="l00074"></a>00074 
<a name="l00080"></a>00080     QString <a class="code" href="class_client.html#a3229de7d5cb5663f39ea1f0ed783c4d8" title="Method that receives the message from the client.">getMessage</a>();
<a name="l00081"></a>00081 
<a name="l00087"></a>00087     QStringList <a class="code" href="class_client.html#a7f6bbe8ce1a9bc59ff62f36e20e5a774" title="Method that gets the users that are online.">getOnlineList</a>();
<a name="l00088"></a>00088 
<a name="l00094"></a>00094     QTcpSocket *<a class="code" href="class_client.html#a11e6fc8ed2cdd2a1e266df6c62394cfc" title="Method that gets the clients QTcpSocket.">getClient</a>();
<a name="l00095"></a>00095 
<a name="l00105"></a>00105     <span class="keywordtype">void</span> <a class="code" href="class_client.html#a5f4363d2e77253aefeab670779bf60cf" title="Method that sends the message.">sendMessage</a>(QString,QString,QString,QString);
<a name="l00106"></a>00106 
<a name="l00107"></a>00107 signals:
<a name="l00108"></a>00108 
<a name="l00116"></a>00116     <span class="keywordtype">void</span> <a class="code" href="class_client.html#a4de68f2ebb2fb0601b57cf785686594a" title="Signal that verifies the username.">usernameValidConfirmation</a>(QString, <span class="keywordtype">bool</span>);
<a name="l00117"></a>00117 
<a name="l00125"></a>00125     <span class="keywordtype">void</span> <a class="code" href="class_client.html#aa12dc1c3a721a7d0bbd341d617bef834" title="Signal that verifies if a friend exists.">friendExistsConfirmation</a>(QString, <span class="keywordtype">bool</span>);
<a name="l00126"></a>00126 
<a name="l00134"></a>00134     <span class="keywordtype">void</span> <a class="code" href="class_client.html#a0a9e90059f470c13bd0d80b297007426" title="Signal that verifies if a friend exists to be removed.">friendRemoveExistsConfirmation</a>(QString, <span class="keywordtype">bool</span>);
<a name="l00135"></a>00135 
<a name="l00142"></a>00142     <span class="keywordtype">void</span> <a class="code" href="class_client.html#af8865e73456733682c8796f32256a2c5" title="Signal that sends the list of users.">signalUsers</a>(QStringList);
<a name="l00143"></a>00143 
<a name="l00152"></a>00152     <span class="keywordtype">void</span> <a class="code" href="class_client.html#a45777f50a03af371db0ca9be4d65d42c" title="Slot that receives the message.">receiveMessage</a>(QString,QString,QString,QString);
<a name="l00153"></a>00153 
<a name="l00160"></a>00160     <span class="keywordtype">void</span> <a class="code" href="class_client.html#acda171c02ce4abc3161cf1ffc99cf1d9" title="Signal that sends out a friend request.">friendRequest</a>(QString);
<a name="l00161"></a>00161 
<a name="l00162"></a>00162 <span class="keyword">private</span>:
<a name="l00164"></a><a class="code" href="class_client.html#a87e8275b86c4d344832374d9bf4aaf7f">00164</a>     QTcpSocket *<a class="code" href="class_client.html#a87e8275b86c4d344832374d9bf4aaf7f" title="Create a client instance variable.">client</a>;
<a name="l00165"></a>00165 
<a name="l00167"></a><a class="code" href="class_client.html#a955368517c3df7db98439442267a603c">00167</a>     quint16 <a class="code" href="class_client.html#a955368517c3df7db98439442267a603c" title="Create a port variable.">port</a>;
<a name="l00168"></a>00168 
<a name="l00170"></a><a class="code" href="class_client.html#aabaf912148bc9f464b7cbaa16584ffa6">00170</a>     QString <a class="code" href="class_client.html#aabaf912148bc9f464b7cbaa16584ffa6" title="Create a string username variable.">userName</a>;
<a name="l00171"></a>00171 
<a name="l00173"></a><a class="code" href="class_client.html#ae5c9dc626ad8d7766c9b583f77fbaad9">00173</a>     QString <a class="code" href="class_client.html#ae5c9dc626ad8d7766c9b583f77fbaad9" title="Create a string message variable.">message</a>;
<a name="l00174"></a>00174 
<a name="l00176"></a><a class="code" href="class_client.html#a6fa0bad86c4de7169b1cdc7775bcdb9e">00176</a>     QString <a class="code" href="class_client.html#a6fa0bad86c4de7169b1cdc7775bcdb9e" title="IP address variable.">address</a>;
<a name="l00177"></a>00177 
<a name="l00179"></a><a class="code" href="class_client.html#a678440a249d44a37cdf7d06fafc973cc">00179</a>     QStringList <a class="code" href="class_client.html#a678440a249d44a37cdf7d06fafc973cc" title="List of friends online variable.">onlineUsers</a>;
<a name="l00180"></a>00180 
<a name="l00181"></a>00181 <span class="keyword">public</span> slots:
<a name="l00182"></a>00182 
<a name="l00187"></a>00187     <span class="keywordtype">void</span> <a class="code" href="class_client.html#a29a650ba41d4fc143b39c00e73047e60" title="Method that sends all the user information to the server.">sendUserInformation</a>();
<a name="l00188"></a>00188 
<a name="l00189"></a>00189 
<a name="l00194"></a>00194     <span class="keywordtype">void</span> <a class="code" href="class_client.html#acfd4db27c0fec82a26e4d112b585b534" title="Method that receives messages from the server.">readyRead</a>();
<a name="l00195"></a>00195 
<a name="l00196"></a>00196 <span class="keyword">private</span> slots:
<a name="l00197"></a>00197 
<a name="l00204"></a>00204     <span class="keywordtype">void</span> <a class="code" href="class_client.html#aad6b45227b92d358869f5bb9b6e5cae7" title="Slot that deals with the user wanting to send a friend request.">handleOutgoingFriendRequest</a>(QString);
<a name="l00205"></a>00205 
<a name="l00212"></a>00212     <span class="keywordtype">void</span> <a class="code" href="class_client.html#a80e6af37a0649f4b9c01e6cfc504103e" title="Slot that deals with the user wanting to remove a friend.">handleFriendRemoveRequest</a>(QString);
<a name="l00213"></a>00213 
<a name="l00221"></a>00221     <span class="keywordtype">void</span> <a class="code" href="class_client.html#a2181e7e27fa6c160493e5c3826d2950e" title="Slot that handles a friend request confirmation from the user.">handleFriendRequestConfirmation</a>(QString, <span class="keywordtype">bool</span>);
<a name="l00222"></a>00222 };
<a name="l00223"></a>00223 
<a name="l00224"></a>00224 <span class="preprocessor">#endif // CLIENT_H</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Tue Nov 29 2011 23:53:09 for N3RD CH4T by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
